{include file="public/header" /}
<style>
  body {
    background: #FFF;
  }
</style>

<div class="page">
  <a href="javascript:history.go(-1)" class="btn" title="返回上一步">返回上一步</a>
  <table class="ds-default-table order">
    <tbody>
      <tr>
        <th>{$Think.lang.order_info}</th>
      </tr>
      <tr>
        <td colspan="2">
          <ul>
            <li><strong>{$Think.lang.ds_order_sn}:</strong>{$order_list.order_sn}</li>
            <li><strong>{$Think.lang.ds_pay_sn}</strong>{$order_list.pay_sn}</li>

            <li><strong>{$Think.lang.order_state}:</strong>
              {if condition="($order_list.order_state==40)"}已完成
              {elseif condition="($order_list.order_state!=40)"}{$order_status[$order_list['order_state']]}
              {/if}
            </li>

            <li><strong>定制费用:</strong>{$order_list.project_price}</li>
            <li><strong>咨询费:</strong>{$order_list.fee_price}</li>
            <li><strong>服务费:</strong>{$order_list.charge_price}</li>
            <li><strong>实施费:</strong>{$order_list.plementation_price}</li>
            <li><strong>{$Think.lang.order_total_price}:</strong><span
                class="red_common">{$Think.lang.currency}{$order_list.order_amount} </span>
              {if $order_list.refund_amount > 0}
              ({$Think.lang.order_refund}:{$Think.lang.currency}{$order_list.refund_amount})
              {/if}
            </li>
            <li><strong>实付款:</strong>{$Think.lang.currency}{$order_list.actual_amount}</li>
          </ul>
        </td>
      </tr>
      <tr>
        <td>
          <ul>
            <li><strong>{$Think.lang.ds_buyer_name}{$Think.lang.ds_colon}</strong>{$order_list.buyer_name}</li>

            <?php if(!empty($order_list['payment_time'])){ ?>
            <li>
              <strong>{$Think.lang.ds_payment_code}{$Think.lang.ds_colon}</strong>{:get_order_payment_name($order_list['payment_code'])}
            </li>
            <?php }?>

            <li><strong>{$Think.lang.order_time}{$Think.lang.ds_colon}</strong>{$order_list.add_time|date='Y-m-d
              H:i:s',###}</li>

            <?php if(!empty($order_list['payment_time'])){ ?>
            <li><strong>支付时间</strong>
              {$order_list.payment_time|date='Y-m-d H:i:s',###}
            </li>
            <?php }?>

          </ul>
        </td>
      </tr>
      <tr>
        <th>{$Think.lang.consignee_info}</th>
      </tr>
      <tr>
        <td>
          <ul>
            <li><strong>{$Think.lang.consignee_name}{$Think.lang.ds_colon}</strong>{$order_list.reciver_name}</li>
            <li>
              <strong>{$Think.lang.tel_phone}{$Think.lang.ds_colon}</strong>{$order_list.extend_order_common.reciver_info.phone|default=''}
            </li>
            <li>
              <strong>{$Think.lang.address}{$Think.lang.ds_colon}</strong>{$order_list.extend_order_common.reciver_info.address|default=''}
            </li>
          </ul>
        </td>
      </tr>

      <form id="store_form" method="post" novalidate="novalidate">
        <!-- 商品信息 -->
        <tr>
          <th>
            {$Think.lang.product_info}
            <a style="margin-left: 50px;" href="javascript:void(0);" onclick="service_goods({$order_id},{$project_id});"
              class="btn">导入商品</a>
          </th>
        </tr>
        {notempty name="$order_list.extend_project_service_goods"}
        <input type="hidden" id="commodity" value="1">
        <tr>
          <td>
            <table class="ds-default-table goods ">
              <tbody>
                <tr>
                  <th>展示图</th>
                  <th>{$Think.lang.product_info}</th>
                  <th class="align-center">{$Think.lang.product_price}</th>
                  <th class="align-center">{$Think.lang.product_num}</th>
                </tr>
                {foreach name="$order_list.extend_project_service_goods" item="goods"}
                <tr>
                  <td class="w60 picture">
                    <div class="size-56x56"><span class="thumb size-56x56"><i></i><img src={$goods['goods_image']}
                          width="60" height="60" /> </span></div>
                  </td>
                  <td class="w96 align-center"><span class="red_common">{$goods.goods_name}</span></td>
                  <td class="w96 align-center"><span
                      class="red_common">{$Think.lang.currency}{$goods.goods_price}</span></td>
                  <td class="w96 align-center">{$goods.goods_num}</td>
                </tr>
                {/foreach}
              </tbody>
            </table>
          </td>
        </tr>
        {/notempty}
        <table class="ds-default-table">
          <!--店主账号-->
          <tbody>
            <input type="hidden" name="order_id" value={$order_id}>
            <tr class="noborder" style="background: rgb(255, 255, 255);">
              <td style="width: 100px;" class="required">预计工时: </td>
              <td class="vatop rowform">
                <input type="text" name="need_hours" id="need_hours" class="txt">
              </td>
            </tr>
            <tr class="noborder" style="background: rgb(255, 255, 255);">
              <td style="width: 100px;" class="required">每工时单价: </td>
              <td class="vatop rowform">
                <input type="text" name="fuwu_hour" id="fuwu_hour" class="txt">
              </td>
              <td class="vatop tips">* 请输入数字,系统根据当前地区建议单小时价格</td>
            </tr>
            <tr class="noborder" style="background: rgb(255, 255, 255);">
              <td style="width: 100px;" class="required">上门费: </td>
              <td class="vatop rowform">
                <input type="text" name="door_fee" id="door_fee" class="txt">
              </td>
              <td class="vatop tips">* 请输入数字</td>
            </tr>
            <tr class="noborder">
              <td class="w120">预约时间:</td>
              <td class="vatop rowform">
                <input style="width: 250px;" id="appointment_time" name="appointment_time" type="text"
                  class="text w130" />
              </td>
            </tr>
            <tr class="noborder" style="background: rgb(255, 255, 255);">
              <td class="required">服务内容: </td>
              <td class="vatop rowform">
                <textarea name="service_content" class="tarea"></textarea>
              </td>
              <td class="vatop tips">* 请输入服务内容</td>
            </tr>
            <tr class="noborder" style="background: rgb(255, 255, 255);">
              <td class="required">备注: </td>
              <td class="vatop rowform">
                <textarea name="remarks" class="tarea"></textarea>
              </td>
              <td class="vatop tips">* 请输入备注</td>
            </tr>
          </tbody>
          <tfoot>
            <tr class="tfoot">
              <td colspan="15"><input class="btn" type="submit" value="提交"></td>
            </tr>
          </tfoot>
        </table>
      </form>
    </tbody>
  </table>
</div>
<script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js" charset="utf-8"></script>
<script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.mousewheel.js"></script>
<link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/css/lightbox.min.css">
<script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/js/lightbox.min.js"></script>
<link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.css">
<script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.js"></script>
<script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/i18n/jquery-ui-timepicker-zh-CN.js"></script>
<script>
  $(document).ready(function () {
    $("form").submit(function (e) {
      var commodity = $('#commodity').val();
      if(commodity != 1){
        layer.msg('请导入商品');
        return false;
      }
      var need_hours = $('#need_hours').val();
      var fuwu_hour = $('#fuwu_hour').val();
      var door_fee = $('#door_fee').val();
      if (need_hours == '') {
        layer.msg('请填写预计工时');
        return false;
      }
      if (fuwu_hour == '') {
        layer.msg('请填写每工时单价');
        return false;
      }
      if (door_fee == '') {
        layer.msg('请填写上门费');
        return false;
      }

    });
  });

  function service_goods(ids_str, ids_str2) {
    _uri = ADMINSITEURL + "/projectorder/service_goods?order_id=" + ids_str + "&project_id=" + ids_str2;
    dsLayerOpen(_uri, '导入商品', '1100px', '700px');
  }

  $(function () {
    $('#appointment_time').datetimepicker({
      dateFormat: 'yy-mm-dd'
    });
    $('#end_time').datetimepicker({
      dateFormat: 'yy-mm-dd'
    });

    $('div[dstype="editStoreContent"] > ul').find('li').click(function () {
      $(this).addClass('current').siblings().removeClass('current');
      var _index = $(this).index();
      var _form = $('div[dstype="editStoreContent"]').find('form');
      _form.hide();
      _form.eq(_index).show();
    });
  });

  /**
   * Layer 通用ifram弹出窗口
   */
  function dsLayerOpen(url, title, width, height) {
    if (!width) width = '900px';
    if (!height) height = '500px';
    layer.open({
      type: 2,
      title: title,
      area: [width, height],
      fixed: false, //不固定
      maxmin: true,
      content: url
    });
  }
</script>